﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace BuisnessLayer
{
    /// <summary>
    /// Interaction logic for TargetAsker.xaml
    /// </summary>
    public partial class TargetAsker : Window
    {
        private AskerMessage _message;
        private Type _type;
        public object Answer{get;set;}

        public TargetAsker(AskerMessage pMessage)
        {
            InitializeComponent();
            _message = pMessage;
            LoadMessage();
        }

        public string ResponseText {
            get { return ResponseTextBox.Text; }
            set { ResponseTextBox.Text = value; }
        }

        private void LoadMessage() {
            if (!String.IsNullOrEmpty(_message.Title))
                this.Title = _message.Title;
            if (!String.IsNullOrEmpty(_message.Message))
                this.Message.Text = _message.Message;
            if (!String.IsNullOrEmpty(_message.ConfirmContent))
                this.ConfirmButton.Content = _message.ConfirmContent;

            //if (!String.IsNullOrEmpty(_message.DiscardContent))
            //    this.DiscardButton.Content = _message.DiscardContent;

            SetDataForm();
        }

        private void SetDataForm()
        {
            
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            this.DialogResult = true;
            this.Close();
        }
    }
}
